<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/jsp/manage/common/taglibs.jsp" %>
<c:if test="${initParam['ssoEnable']=='true'}">
    <%@ include file="/WEB-INF/jsp/manage/common/ssoInclude.jsp" %>
</c:if>
<script type="text/javascript">
    $(function () {
        $.acooly.framework.registerKeydown('manage_merchant_searchform', 'manage_merchant_datagrid');
    });

</script>
<div class="easyui-layout" data-options="fit : true,border : false">
    <!-- 查询条件 -->
    <div data-options="region:'north',border:false" style="padding:5px; overflow: hidden;" align="left">
        <form id="manage_merchant_searchform" onsubmit="return false">
            <table class="tableForm" width="100%">
                <tr>
                    <td align="left">
                        <div>
                            商户ID: <input type="text" class="text" size="15" name="search_LIKE_accountNo"/>
                            <c:if test="${merchantTag != 'agent'}">
                                上级商户ID: <input type="text" class="text" size="15" name="search_LIKE_parentMerchantId"/>
                            </c:if>
                            商户名: <input type="text" class="text" size="15" name="search_LIKE_merchantName"/>
                            手机号: <input type="text" class="text" size="15" name="search_LIKE_mobile"/>
                            邮箱: <input type="text" class="text" size="15" name="search_LIKE_email"/>
                            <a href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:false"
                               onclick="$.acooly.framework.search('manage_merchant_searchform','manage_merchant_datagrid');"><i
                                    class="fa fa-search fa-lg fa-fw fa-col"></i>查询</a>
                        </div>
                    </td>
                </tr>
            </table>
        </form>
    </div>

    <!-- 列表和工具栏 -->
    <div data-options="region:'center',border:false">
        <table id="manage_merchant_datagrid" class="easyui-datagrid"
               url="${pageContext.request.contextPath}/manage/merchant/merchant/${merchantTag == 'agent'? 'agentListJson.html':'listJson'}"
               toolbar="#manage_merchant_toolbar" fit="true" border="false" fitColumns="false"
               pagination="true" idField="id" pageSize="20" pageList="[ 10, 20, 30, 40, 50 ]" sortName="id"
               sortOrder="desc" checkOnSelect="true" selectOnCheck="true" singleSelect="true">
            <thead>
            <tr>
                <th field="showCheckboxWithId" checkbox="true"
                    data-options="formatter:function(value, row, index){ return row.id }">编号
                </th>
                <th field="id" sum="true">id</th>
                <th field="parentMerchantId">上级商户ID</th>
                <th field="merchantId">商户ID</th>
                <th field="merchantName">商户名称</th>
                <th field="merchantType">商户类型</th>
                <th field="contact">联系人</th>
                <th field="mobile">手机号</th>
                <th field="email">邮箱</th>
                <th field="address">地址</th>
                <th field="createTime" formatter="formatDate">添加时间</th>
                <th field="updateTime" formatter="formatDate">更新时间</th>
                <th field="rowActions" data-options="formatter:function(value, row, index){return formatAction('manage_merchant_action',value,row)}"> 动作
                </th>
            </tr>
            </thead>
        </table>

        <!-- 每行的Action动作模板 -->
        <div id="manage_merchant_action" style="display: none;">
            <a onclick="$.acooly.framework.edit({url:'/manage/merchant/merchant/${merchantTag == 'agent'?'agentEdit.html':'edit.html'}',id:'{0}',entity:'merchant',width:500,height:400});"
               href="#" title="编辑"><i class="fa fa-pencil fa-lg fa-fw fa-col"></i></a>
            <a onclick="$.acooly.framework.show('/manage/merchant/merchant/${merchantTag == 'agent'? 'agentShow.html':'show.html'}?id={0}',500,400);" href="#"
               title="查看"><i class="fa fa-file-o fa-lg fa-fw fa-col"></i></a>
            <a onclick="$.acooly.framework.remove('/manage/merchant/merchant/deleteJson.html','{0}','manage_merchant_datagrid');"
               href="#" title="删除"><i class="fa fa-trash-o fa-lg fa-fw fa-col"></i></a>
        </div>

        <!-- 表格的工具栏 -->
        <div id="manage_merchant_toolbar">
            <a href="#" class="easyui-linkbutton" plain="true"
               onclick="$.acooly.framework.create({url:'/manage/merchant/merchant/${merchantTag == 'agent'?'agentCreate.html':'create.html'}',entity:'merchant',width:500,height:400})"><i
                    class="fa fa-plus-circle fa-lg fa-fw fa-col"></i>添加</a>
            <a href="#" class="easyui-linkbutton" plain="true"
               onclick="$.acooly.framework.removes('/manage/merchant/merchant/deleteJson.html','manage_merchant_datagrid')"><i
                    class="fa fa-trash-o fa-lg fa-fw fa-col"></i>批量删除</a>
            <a href="#" class="easyui-menubutton" data-options="menu:'#manage_merchant_exports_menu'"><i
                    class="fa fa-arrow-circle-o-down fa-lg fa-fw fa-col"></i>批量导出</a>
            <div id="manage_merchant_exports_menu" style="width:150px;">
                <div onclick="$.acooly.framework.exports('/manage/merchant/merchant/exportXls.html','manage_merchant_searchform','merchant')">
                    <i class="fa fa-file-excel-o fa-lg fa-fw fa-col"></i>Excel
                </div>
                <div onclick="$.acooly.framework.exports('/manage/merchant/merchant/exportCsv.html','manage_merchant_searchform','merchant')">
                    <i class="fa fa-file-text-o fa-lg fa-fw fa-col"></i>CSV
                </div>
            </div>
            <a href="#" class="easyui-linkbutton" plain="true"
               onclick="$.acooly.framework.imports({url:'/manage/merchant/merchant/importView.html',uploader:'manage_merchant_import_uploader_file'});"><i
                    class="fa fa-arrow-circle-o-up fa-lg fa-fw fa-col"></i>批量导入</a>
        </div>
    </div>

</div>
